//
// Created by 17775 on 2024/10/31.
//

#ifndef RAYCI_LIVEMODE_HISTOGRAM_H
#define RAYCI_LIVEMODE_HISTOGRAM_H

#include <atomic>
#include <vector>
#include <memory>
#include <thread>
#include "RayCiPro_C.h"
#include "../utils/HistogramDataReceiveQueueObserver.h"

class LiveMode_Histogram {

public:
    explicit LiveMode_Histogram(int &docId);
    ~LiveMode_Histogram();
    std::atomic<bool> _isGettingNewHistogramData = false;
    void getData();
    int _nDocIdLive = 0;
    std::thread m_histogramThread;
    void addHistogramDataReceiveListener(HistogramDataReceiveListener *listener) const;
    void stopHistogramThread();
    void closeHistogramWindow() const;

private:
    HistogramDataReceiveQueueObserver *histogramDataReceiveQueueObserver = nullptr;
    void getHistogramData();
};


#endif //RAYCI_LIVEMODE_HISTOGRAM_H
